package com.ruoyi.admin.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.admin.mapper.MlCarouselDtoMapper;
import com.ruoyi.admin.domain.MlCarouselDto;
import com.ruoyi.admin.service.IMlCarouselDtoService;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-18
 */
@Service
public class MlCarouselDtoServiceImpl extends ServiceImpl<MlCarouselDtoMapper, MlCarouselDto> implements IMlCarouselDtoService
{
    @Autowired
    private MlCarouselDtoMapper mlCarouselDtoMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public MlCarouselDto selectMlCarouselDtoById(Long id)
    {
        return mlCarouselDtoMapper.selectMlCarouselDtoById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param mlCarouselDto 轮播图
     * @return 轮播图
     */
    @Override
    public List<MlCarouselDto> selectMlCarouselDtoList(MlCarouselDto mlCarouselDto)
    {
        return mlCarouselDtoMapper.selectMlCarouselDtoList(mlCarouselDto);
    }

    /**
     * 新增轮播图
     * 
     * @param mlCarouselDto 轮播图
     * @return 结果
     */
    @Override
    public int insertMlCarouselDto(MlCarouselDto mlCarouselDto)
    {
        mlCarouselDto.setCreateTime(DateUtils.getNowDate());
        return mlCarouselDtoMapper.insertMlCarouselDto(mlCarouselDto);
    }

    /**
     * 修改轮播图
     * 
     * @param mlCarouselDto 轮播图
     * @return 结果
     */
    @Override
    public int updateMlCarouselDto(MlCarouselDto mlCarouselDto)
    {
        return mlCarouselDtoMapper.updateMlCarouselDto(mlCarouselDto);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMlCarouselDtoByIds(Long[] ids)
    {
        return mlCarouselDtoMapper.deleteMlCarouselDtoByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteMlCarouselDtoById(Long id)
    {
        return mlCarouselDtoMapper.deleteMlCarouselDtoById(id);
    }
}
